]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Disconnect overview signals on destroy
authorfthx <17156-fthx@users.noreply.gitlab.gnome.org>
Mon, 16 Feb 2026 09:41:58 +0000 (09:41 +0000)
committerMarge Bot <marge-bot@gnome.org>
Wed, 15 Apr 2026 20:47:54 +0000 (20:47 +0000)
While we never destroy the dash ourselves, extensions that replace it
might, so better disconnect the signals properly instead of leaking
the handlers in that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4077>

js/ui/dash.js

index 1df9414b4357679cffe58db72eeccb600214dfbd..8dc16dc6a330165ec0135fdeb3ec1f98b845f45b 100644 (file)
@@ -387,18 +387,14 @@ export const Dash = GObject.registerClass({
         AppFavorites.getAppFavorites().connect('changed', this._queueRedisplay.bind(this));
         this._appSystem.connect('app-state-changed', this._queueRedisplay.bind(this));
 
-        Main.overview.connect('item-drag-begin',
-            this._onItemDragBegin.bind(this));
-        Main.overview.connect('item-drag-end',
-            this._onItemDragEnd.bind(this));
-        Main.overview.connect('item-drag-cancelled',
-            this._onItemDragCancelled.bind(this));
-        Main.overview.connect('window-drag-begin',
-            this._onWindowDragBegin.bind(this));
-        Main.overview.connect('window-drag-cancelled',
-            this._onWindowDragEnd.bind(this));
-        Main.overview.connect('window-drag-end',
-            this._onWindowDragEnd.bind(this));
+        Main.overview.connectObject(
+            'item-drag-begin', () => this._onItemDragBegin(),
+            'item-drag-end', () => this._onItemDragEnd(),
+            'item-drag-cancelled', () => this._onItemDragCancelled(),
+            'window-drag-begin', () => this._onWindowDragBegin(),
+            'window-drag-cancelled', () => this._onWindowDragEnd(),
+            'window-drag-end', () => this._onWindowDragEnd(),
+            this);
 
         // Translators: this is the name of the dock/favorites area on
         // the bottom of the overview